<?php
/**
 * User: lie
 * Date: 2020-11-10 0:07
 * description:
 */

?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>指定次数循环</title>
</head>
<body>


    <form action="" method="post">
            <input type="text" name="text" id="">
            <input type="submit" value="执行" name="sub">
        <br>
               <?php
                        if ($_POST['sub']){
                            $text = $_POST['text'];
                            for ($i = 1; $i <= $text; $i++){
                                if ($i > $text){
                                    break;
                                } else {
                                    echo "已经删除".$i."次循环";
                                    echo "<br>";

                                }
                            }
                        }
                    ?>
    </form>
</body>
</html>